<!doctype html>
<script src="../../../resources/testharness.js"></script>
<script src="../../../resources/testharnessreport.js"></script>
<script src="../../assert_selection.js"></script>
<script>
if (window.internals)
  internals.settings.setEditingBehavior('win');

selection_test(
  '<div contenteditable dir="rtl">|abc def    hij opq</div>',
  selection => selection.modify('move', 'right', 'word'),
  '<div contenteditable dir="rtl">|abc def    hij opq</div>',
  '13-0 right word');

selection_test(
  '<div contenteditable dir="rtl">a|bc def    hij opq</div>',
  selection => selection.modify('move', 'right', 'word'),
  '<div contenteditable dir="rtl">|abc def    hij opq</div>',
  '13-1 right word');

selection_test(
  '<div contenteditable dir="rtl">ab|c def    hij opq</div>',
  selection => selection.modify('move', 'right', 'word'),
  '<div contenteditable dir="rtl">|abc def    hij opq</div>',
  '13-2 right word');

selection_test(
  '<div contenteditable dir="rtl">abc| def    hij opq</div>',
  selection => selection.modify('move', 'right', 'word'),
  '<div contenteditable dir="rtl">|abc def    hij opq</div>',
  '13-3 right word');

selection_test(
  '<div contenteditable dir="rtl">abc |def    hij opq</div>',
  selection => selection.modify('move', 'right', 'word'),
  '<div contenteditable dir="rtl">|abc def    hij opq</div>',
  '13-4 right word');

selection_test(
  '<div contenteditable dir="rtl">abc d|ef    hij opq</div>',
  selection => selection.modify('move', 'right', 'word'),
  '<div contenteditable dir="rtl">abc |def    hij opq</div>',
  '13-5 right word');

selection_test(
  '<div contenteditable dir="rtl">abc de|f    hij opq</div>',
  selection => selection.modify('move', 'right', 'word'),
  '<div contenteditable dir="rtl">abc |def    hij opq</div>',
  '13-6 right word');

selection_test(
  '<div contenteditable dir="rtl">abc def|    hij opq</div>',
  selection => selection.modify('move', 'right', 'word'),
  '<div contenteditable dir="rtl">abc |def    hij opq</div>',
  '13-7 right word');

selection_test(
  '<div contenteditable dir="rtl">abc def |   hij opq</div>',
  selection => selection.modify('move', 'right', 'word'),
  '<div contenteditable dir="rtl">abc |def    hij opq</div>',
  '13-8 right word');

selection_test(
  '<div contenteditable dir="rtl">abc def  |  hij opq</div>',
  selection => selection.modify('move', 'right', 'word'),
  '<div contenteditable dir="rtl">abc |def    hij opq</div>',
  '13-9 right word');

selection_test(
  '<div contenteditable dir="rtl">abc def   | hij opq</div>',
  selection => selection.modify('move', 'right', 'word'),
  '<div contenteditable dir="rtl">abc |def    hij opq</div>',
  '13-10 right word');

selection_test(
  '<div contenteditable dir="rtl">abc def    |hij opq</div>',
  selection => selection.modify('move', 'right', 'word'),
  '<div contenteditable dir="rtl">abc |def    hij opq</div>',
  '13-11 right word');

selection_test(
  '<div contenteditable dir="rtl">abc def    h|ij opq</div>',
  selection => selection.modify('move', 'right', 'word'),
  '<div contenteditable dir="rtl">abc def |   hij opq</div>',
  '13-12 right word');

selection_test(
  '<div contenteditable dir="rtl">abc def    hi|j opq</div>',
  selection => selection.modify('move', 'right', 'word'),
  '<div contenteditable dir="rtl">abc def |   hij opq</div>',
  '13-13 right word');

selection_test(
  '<div contenteditable dir="rtl">abc def    hij| opq</div>',
  selection => selection.modify('move', 'right', 'word'),
  '<div contenteditable dir="rtl">abc def |   hij opq</div>',
  '13-14 right word');

selection_test(
  '<div contenteditable dir="rtl">abc def    hij |opq</div>',
  selection => selection.modify('move', 'right', 'word'),
  '<div contenteditable dir="rtl">abc def |   hij opq</div>',
  '13-15 right word');

selection_test(
  '<div contenteditable dir="rtl">abc def    hij o|pq</div>',
  selection => selection.modify('move', 'right', 'word'),
  '<div contenteditable dir="rtl">abc def    hij |opq</div>',
  '13-16 right word');

selection_test(
  '<div contenteditable dir="rtl">abc def    hij op|q</div>',
  selection => selection.modify('move', 'right', 'word'),
  '<div contenteditable dir="rtl">abc def    hij |opq</div>',
  '13-17 right word');

selection_test(
  '<div contenteditable dir="rtl">abc def    hij opq|</div>',
  selection => selection.modify('move', 'right', 'word'),
  '<div contenteditable dir="rtl">abc def    hij |opq</div>',
  '13-18 right word');
</script>
